package com.etms.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    //前后端数据一致,返回统一的数据
    private Boolean success;

    private String msg;

    private Object data;


    public static Result successed(Object data){
        return new Result(true,"成功",data);
    }

    public static Result successed(String msg,Object data){
        return new Result(true,msg,data);
    }


    public static Result failed(){
        return new Result(false,"失败",null);
    }

    public static Result failed(String msg){
        return new Result(false,msg,null);
    }
}
